package com.paic.icore.test.demo.jasypt;

import org.jasypt.encryption.StringEncryptor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * describe:
 *
 * @author huxingjie
 * @date 2019/06/03
 * @since 3.6
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class JasyptTes {

    @Autowired
    StringEncryptor encryptor;

    @Test
    public void getPass() {
        String name = encryptor.encrypt("abc");
        String password = encryptor.encrypt("123");
        System.out.println(name);
        System.out.println(password);
        System.out.println(encryptor.decrypt("Smhao5pdMRQ4TZ38Pw9lIo6uTjDtl6Mf"));
    }
}

    